//
// reqengine - reqengine source code.
//
// $Rev$
// $Author$
// $Date$
//
// Define class RequestContent.
//

#ifndef __REQUEST__CONTENT__H
#define __REQUEST__CONTENT__H

namespace reqengine {

class HttpRequest;
class Request;
class ResponseContent;

class RequestContent {
 public:
  RequestContent() : request_(NULL) {}
  virtual ~RequestContent() {}

  // Initialize, support protobuf and http.
  virtual void Initialize(const google::protobuf::Message* message) = 0;
  virtual void Initialize(const HttpRequest *request) = 0;

  // Divied.
  virtual void RequireDivide() = 0;
  virtual size_t DivideSize() const = 0;
  virtual RequestContent *Divide(size_t pos) = 0;

  // Create a response by this type.
  virtual ResponseContent *CreateResponse() = 0;

 private:
  Request *request_;
};

}  // namespace reqengine

#endif  // __REQUEST__CONTENT__H

